﻿using Common.Interfaces;

namespace Domain.ValueObjects
{
    /// <summary>
    /// 学院和专业信息
    /// </summary>
    public class AcademicInfo : ValueObject
    {
        public string CollegeName { get; init; }
        public string MajorName { get; init; }

        private AcademicInfo(string collegeName,  string majorName)
        {
            CollegeName = collegeName;
            MajorName = majorName;
        }

        public static AcademicInfo Create( string collegeName, string majorName)
        {
            return new AcademicInfo(collegeName, majorName);
        }

        protected override IEnumerable<object> GetEqualityComponents()
        {
            yield return CollegeName;
            yield return MajorName;
        }
    }
}
